/* 评估相关请求模块 */
import request from '../utils/request'
// import qs from 'qs'

// 待评估列表
export const wait_pinggu_list = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/listAssessHandlePage',
    params
  })
};

// 根据身份证获取评估信息
export const get_pg_infos = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/assessHandleByIdNumber',
    params
  })
};

export const get_health_record = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/getLatestDiseaseHealth',
    params
  })
};

// ocr
export const get_ocr = data => {
  return request({
    method: 'POST',
    url: '/ocr',
    headers:{
      'Content-Type':'application/json;charset=UTF-8'
    },
    // headers: {
    //   'Content-Type': 'application/x-www-form-urlencoded'
    // },
    data
  })
};

// 获取日历数据
export const get_day = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/assessMonthStat',
    params
  })
};

// 获取评估模板
export const get_model_infos = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/assessProgramLoad',
    params
  })
};

// 获取评估大项结果
export const get_result = data => {
  return request({
    method: 'POST',
    url: '/api/appAssess/getAssessOptionRank',
    data
  })
};

// 获取评估暂存详情
export const get_detail = (url,params) => {
  return request({
    method: 'GET',
    url: `/api/${url}`,
    params
  })
};

// 获取评估最终结果
export const get_result_all = data => {
  return request({
    method: 'POST',
    url: '/api/appAssess/getAssessResultRank',
    data
  })
};

// 获取评估最终结果-国标
export const get_result_all_GB = data => {
  return request({
    method: 'POST',
    url: '/api/appAssess/getAssessResultRankGuoBiao',
    data
  })
};

// 根据日期获取评估数据
export const get_pgList_date = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/assessHandleByDate',
    params
  })
};

// 获取评估对象信息
export const get_infos = (url,params) => {
  return request({
    method: 'GET',
    url: `/api${url}`,
    params
  })
};

// 评估详情
export const pinggu_detail = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/getDetail',
    params
  })
};

export const get_num = params => {
  return request({
    method: 'GET',
    url: '/api/appAssess/getAssessHandleCount',
    params
  })
};

// 获取评估模板
export const get_pinggu_template = data => {
  return request({
    method: 'GET',
    url: '/api/assessElder/assessProgramLoad',
    params: data
  })
};


// 评估档案列表
export const pinggu_record_list = params => {
  return request({
    method: 'get',
    url: '/api/appAssess/listAppAssessRecordPage',
    params
  })
}

// 保存评估
export const pinggu_submit_save = data => {
  return request({
    method: 'POST',
    url: '/api/appAssess/saveAssessRecord',
    data
  })
}

// 暂存评估
export const pinggu_submit = data => {
  return request({
    method: 'POST',
    url: '/api/appAssess/saveAssessRecordTemp',
    data
  })
}

// 获取app版本
export const get_system_version = data => {
  return request({
    method: 'POST',
    url: '/api/assessElder/getVersionNumber',
    data
  })
}

// 获取app版本
export const get_system_version2 = params => {
  return request({
    method: 'GET',
    url: '/api/appVersion/info',
    params
  })
}

// 评估对象登记
export const submit_pgdx = (data,url) => {
  return request({
    method: 'POST',
    url: `/api/${url}`,
    data
  })
}

// 获取评估对象列表
export const get_pgdx_list = data => {
  return request({
    method: 'GET',
    url: '/api/assessElder/listPageAssessElder',
    params: data
  })
}

// 获取评估对象详情
export const getUserApplyInfos = data => {
  return request({
    method: 'GET',
    url: '/api/assessElder/getElderRecord',
    params: data
  })
}

// 获取评估对象详情
export const getPGUser = data => {
  return request({
    method: 'GET',
    url: '/api/assessElder/listEmployeeResolvePage',
    params: data
  })
}

export const get_PG_data = data => {
  return request({
    method: 'GET',
    url: '/api/appAssess/getAppAssessCount',
    params: data
  })
}

export const get_PGDX_data = data => {
  return request({
    method: 'GET',
    url: '/api/assessElder/countElder',
    params: data
  })
}

export const get_PG_echart = data => {
  return request({
    method: 'GET',
    url: '/api/appAssess/getStaticAssessHalfYear',
    params: data
  })
}
